<?
$title = "Edit category";
$pageid = "5";
$accessid = "a00";

require("required/dbconnect.php");
require("required/function.php");
require("required/header.php");

checkAccess("allow_product_category", 1);

$id = de_id($_GET['id']);
$enid = $_GET['id'];
$get_info = mysql_query("select * from os_category where id=$id");

if (mysql_num_rows($get_info) == 0) {
    echo "No record found!!";
} else {


    $a = mysql_fetch_array($get_info, MYSQL_ASSOC);

    if ($a['is_publish'] == 0) {
        $slt0 = "selected";
        $slt1 = "";
    } else {
        $slt0 = "";
        $slt1 = "selected";
    }
    ?>

    <table width="95%" cellpadding="2" cellspacing="1">

        <td valign="top">
            <table>
                <tr>
                    <td colspan="4" class="title">Edit Category</td>
                </tr>
                <form action="cat_edit2.php" method="post" name="frm" onSubmit="return frmValidate(this)">
                    <input type="hidden" value="<?= $enid ?>" name="id">
                    <tr>
                        <td width="18%">Category</td><td width="2%">:</td><td width="80%"><input type="text" size="30" name="category_eng" class="text" value="<?= $a['name_eng'] ?>"></td>
                    </tr>
                    <tr>
                        <td width="18%">Order ID</td><td width="2%">:</td><td width="80%"><input type="text" size="30" name="order_id" class="text" value="<?= $a['order_id'] ?>"></td>
                    </tr>
                    <tr>
                        <td>Display</td><td>:</td><td>
                            <select name="is_publish">
                                <option value="1" <?= $slt1 ?>>Yes</option>
                                <option value="0" <?= $slt0 ?>>No</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                            <td colspan="3" align="center"><br><input type="submit" value="update" class="button">  <input type="button" value="Cancel" class="button" onclick="window.open('cat_management.php','_self')"><br><br></td>
                    </tr>
                </form>
            </table></td>

    </table>
<? } require("required/footer.php"); ?>

